/**
 * 
 */
package vn.smartware.co.framework.config;

import java.io.Serializable;


import java.util.HashMap;

/**
 * SystemConfig
 */
@SuppressWarnings("rawtypes")
public class SystemConfig implements Serializable {

    /**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = -6869076082413745547L;
	private WebServerConfig webServer;
	
	private HashMap formBeans = new HashMap();
	private HashMap globalExceptions = new HashMap();
	private HashMap actionMappings = new HashMap();
	
    /**
     * @return webServer
     */
    public WebServerConfig getWebServer() {
        return webServer;
    }
    
    /**
     * @param webServer webServer
     */
    public void setWebServer(WebServerConfig webServer) {
        this.webServer = webServer;
    }
    
	/**
	 * FormBeansConfig
	 * 
	 * @param beansConfig
	 */
	@SuppressWarnings("unchecked")
	public void addFormBeans(FormBeansConfig beansConfig) {
		formBeans.put(beansConfig.getName(), beansConfig);
	}
	
	/**
	 * FormBeansConfig
	 * @param id
	 * @return formBeansConfig
	 */
	public FormBeansConfig getFormBeans(String id) {
		return (FormBeansConfig) formBeans.get(id);
	}

	/**
	 * GlobalExceptionsConfig
	 * 
	 * @param exceptionConfig
	 */
	@SuppressWarnings("unchecked")
	public void addGlobalExceptions(GlobalExceptionsConfig exceptionConfig) {
		globalExceptions.put(exceptionConfig.getType(), exceptionConfig);
	}
	
	/**
	 * GlobalExceptionConfig
	 * 
	 * @param id
	 * @return globalExceptions
	 */
	public GlobalExceptionsConfig getGlobalExceptions(String id) {
		return (GlobalExceptionsConfig) globalExceptions.get(id);
	}
	
	/**
	 * ActionMappingsConfig
	 * 
	 * @param actionConfig
	 */
	@SuppressWarnings("unchecked")
	public void addActionMappingsConfig(ActionMappingsConfig actionConfig) {
		actionMappings.put(actionConfig.getName(), actionConfig);
	}
	
	/**
	 * ActionMappingsConfig
	 * 
	 * @param id
	 * @return ActionMappingConfig 
	 */
	public ActionMappingsConfig getActionMappingConfig(String id) {
		return (ActionMappingsConfig) actionMappings.get(id);
	}

}
